{% extends "global/Page.html" %}
{% load otree %}

{% block title %}
    分钱游戏
{% endblock %}

{% block content %}



    <body>
    <div>
        {#        <div style="font-size: 28px;text-align: center"><b>#}
        {#            {% if group.round_number == 1 or group.round_number == 2 %}#}
        {#                倒计时为15秒#}
        {#            {% else %}#}
        {#                倒计时为10秒#}
        {#            {% endif %}#}
        {#        </b>#}
        {#        </div>#}
        {#    下面二个标签显示自己和对方的身份！#}
        <div>
             <span>您的身份是： <span style="color: red">
                    {% if player.id_in_subsession == player.session.vars.r1 %}
                        红组
                    {% endif %}
                 {% if player.id_in_subsession == player.session.vars.r2 %}
                     红组
                 {% endif %}
                 {% if player.id_in_subsession == player.session.vars.r3 %}
                     红组
                 {% endif %}
                 {% if player.id_in_subsession == player.session.vars.r4 %}
                     红组
                 {% endif %}
                 {% if player.id_in_subsession == player.session.vars.r5 %}
                     红组
                 {% endif %}
                 {% if player.id_in_subsession == player.session.vars.r6 %}
                     红组
                 {% endif %}
                </span>
                    <span style="color: blue">
                    {% if player.id_in_subsession == player.session.vars.b1 %}
                        蓝组
                    {% endif %}
                        {% if player.id_in_subsession == player.session.vars.b2 %}
                            蓝组
                        {% endif %}
                        {% if player.id_in_subsession == player.session.vars.b3 %}
                            蓝组
                        {% endif %}
                        {% if player.id_in_subsession == player.session.vars.b4 %}
                            蓝组
                        {% endif %}
                        {% if player.id_in_subsession == player.session.vars.b5 %}
                            蓝组
                        {% endif %}
                        {% if player.id_in_subsession == player.session.vars.b6 %}
                            蓝组
                        {% endif %}
                </span>
                    <span style="color:green;">
                                    {% if player.id_in_subsession == player.session.vars.g1 %}
                                        绿组
                                    {% endif %}
                        {% if player.id_in_subsession == player.session.vars.g2 %}
                            绿组
                        {% endif %}
                        {% if player.id_in_subsession == player.session.vars.g3 %}
                            绿组
                        {% endif %}
                        {% if player.id_in_subsession == player.session.vars.g4 %}
                            绿组
                        {% endif %}
                        {% if player.id_in_subsession == player.session.vars.g5 %}
                            绿组
                        {% endif %}
                        {% if player.id_in_subsession == player.session.vars.g6 %}
                            绿组
                        {% endif %}
                </span></span>
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <span>分钱人A的身份是:
                {% for p in player.get_others_in_group %}
                    {% if  player.get_others_in_group.1 == p %}
                        <span style="color: red">{% if  p.id_in_subsession  == player.session.vars.r1 %}
                            红组
                        {% endif %}
                            {% if p.id_in_subsession == player.session.vars.r2 %}
                                红组
                            {% endif %}
                            {% if p.id_in_subsession == player.session.vars.r3 %}
                                红组
                            {% endif %}
                            {% if p.id_in_subsession == player.session.vars.r4 %}
                                红组
                            {% endif %}
                            {% if p.id_in_subsession == player.session.vars.r5 %}
                                红组
                            {% endif %}
                            {% if p.id_in_subsession == player.session.vars.r6 %}
                                红组
                            {% endif %}</span>
                        <span style="color:blue;">                    {% if p.id_in_subsession == player.session.vars.b1 %}
                            蓝组
                        {% endif %}
                            {% if p.id_in_subsession == player.session.vars.b2 %}
                                蓝组
                            {% endif %}
                            {% if p.id_in_subsession == player.session.vars.b3 %}
                                蓝组
                            {% endif %}
                            {% if p.id_in_subsession == player.session.vars.b4 %}
                                蓝组
                            {% endif %}
                            {% if p.id_in_subsession == player.session.vars.b5 %}
                                蓝组
                            {% endif %}
                            {% if p.id_in_subsession == player.session.vars.b6 %}
                                蓝组
                            {% endif %}</span>
                        <span style="color:green;">                    {% if p.id_in_subsession == player.session.vars.g1 %}
                            绿组
                        {% endif %}
                            {% if p.id_in_subsession == player.session.vars.g2 %}
                                绿组
                            {% endif %}
                            {% if p.id_in_subsession == player.session.vars.g3 %}
                                绿组
                            {% endif %}
                            {% if p.id_in_subsession == player.session.vars.g4 %}
                                绿组
                            {% endif %}
                            {% if p.id_in_subsession == player.session.vars.g5 %}
                                绿组
                            {% endif %}
                            {% if p.id_in_subsession == player.session.vars.g6 %}
                                绿组
                            {% endif %}</span>
                    {% endif %}
                {% endfor %}
                &nbsp&nbsp&nbsp&nbsp分钱人B的身份是:
                {% for p in player.get_others_in_group %} {# 没想到怎么提取 用for来提取集合的列表了 #}
                    {#                队友有两个 要分别进行打印#}

                    {#                根据索引值 player.get_others_in_group.0就是数组的第一个值 1是第二个#}
                    {% if  player.get_others_in_group.0 == p %}
                        <span style="color: red">{% if  p.id_in_subsession  == player.session.vars.r1 %}
                            红组
                        {% endif %}
                            {% if p.id_in_subsession == player.session.vars.r2 %}
                                红组
                            {% endif %}
                            {% if p.id_in_subsession == player.session.vars.r3 %}
                                红组
                            {% endif %}
                            {% if p.id_in_subsession == player.session.vars.r4 %}
                                红组
                            {% endif %}
                            {% if p.id_in_subsession == player.session.vars.r5 %}
                                红组
                            {% endif %}
                            {% if p.id_in_subsession == player.session.vars.r6 %}
                                红组
                            {% endif %}</span>
                        <span style="color:blue;">                    {% if p.id_in_subsession == player.session.vars.b1 %}
                            蓝组
                        {% endif %}
                            {% if p.id_in_subsession == player.session.vars.b2 %}
                                蓝组
                            {% endif %}
                            {% if p.id_in_subsession == player.session.vars.b3 %}
                                蓝组
                            {% endif %}
                            {% if p.id_in_subsession == player.session.vars.b4 %}
                                蓝组
                            {% endif %}
                            {% if p.id_in_subsession == player.session.vars.b5 %}
                                蓝组
                            {% endif %}
                            {% if p.id_in_subsession == player.session.vars.b6 %}
                                蓝组
                            {% endif %}</span>
                        <span style="color:green;">                    {% if p.id_in_subsession == player.session.vars.g1 %}
                            绿组
                        {% endif %}
                            {% if p.id_in_subsession == player.session.vars.g2 %}
                                绿组
                            {% endif %}
                            {% if p.id_in_subsession == player.session.vars.g3 %}
                                绿组
                            {% endif %}
                            {% if p.id_in_subsession == player.session.vars.g4 %}
                                绿组
                            {% endif %}
                            {% if p.id_in_subsession == player.session.vars.g5 %}
                                绿组
                            {% endif %}
                            {% if p.id_in_subsession == player.session.vars.g6 %}
                                绿组
                            {% endif %}</span>
                    {% endif %}
                {% endfor %}
            </span>
            <br>
            <div>
                {% if group.round_number != 1 %}
                    <p>上几轮你们各自要求的游戏币:</p>
                    <table class=table style="width: auto">
                        <tr>
                            <th>轮数</th>
                            {#                {% for i in "1234567" %}#}
                            {#                    <td value={{i}}> {{i}}</td>#}
                            {#                {% endfor %}#}
                            {% for i in game_round %}
                                <td value={{ i }}> {{ i }}</td>
                            {% endfor %}
                        </tr>
                        <tr>
                            <th>游戏币总数</th>
                            {% for group in group.in_previous_rounds %}
                                <td>{{ group.point_pool }}</td>
                            {% endfor %}
                        </tr>
                        <tr>
                            <th>您要求的游戏币</th>
                            {% for player in player.in_previous_rounds %}
                                {% if player.not_refer %}
                                    <td>未提交</td>
                                {% else %}
                                    {% if player.quit_game %}
                                        <td>退出游戏</td>
                                    {% else %}
                                        <td>{{ player.request }}</td>
                                    {% endif %}
                                {% endif %}
                            {% endfor %}
                        </tr>
                        <tr>
                            <th>分钱人A要求的游戏币</th>
                            {% for player in pre_other_player2 %}
                                {% if player.not_refer %}
                                    <td>未提交</td>
                                {% else %}
                                    {% if player.quit_game %}
                                        <td>退出游戏</td>
                                    {% else %}
                                        <td>{{ player.request }}</td>
                                    {% endif %}
                                {% endif %}
                            {% endfor %}
                        </tr>
                        <tr>
                            <th>分钱人B要求的游戏币</th>
                            {% for player in pre_other_player1 %}
                                {% if player.not_refer %}
                                    <td>未提交</td>
                                {% else %}
                                    {% if player.quit_game %}
                                        <td>退出游戏</td>
                                    {% else %}
                                        <td>{{ player.request }}</td>
                                    {% endif %}
                                {% endif %}
                            {% endfor %}
                        </tr>
                        {#                <tr>#}
                        {#                    <th>所有人总共要求的游戏币</th>#}
                        {#                    {% for player in player.in_previous_rounds %}#}
                        {#                    <td>{{ player.request }}</td>#}
                        {#                    {% endfor %}#}
                        {#                </tr>#}

                    </table>
                {% endif %}
            </div>
            <br>

            <div>
                <div>
                    <div style="position:relative;right: -300px">
                        <p style="position:relative;left: 30px; font-size: 20px">游戏币剩余数额: {{ group.point_pool }}</p>
                        <img src="{% static 'picture/money.jpg' %}" width="96.6" height="119"
                             style="position:relative;right: -70px"/>
                        <p style="font-size: 20px">您想要从所有游戏币中获得多少？（倒计时已开始计时）</p>
                        <div>
                            <div> {% formfield player.request label=request_label %}</div>
                            <div style="float: left">
                                <button name="quit_game" value="False" id="btn-quit"
                                        style="font-size:20px;width:100px;height:40px;font-family:黑体;">提交需求
                                </button>
                            </div>
                        </div>
                    </div>
                    <br><br><br>
                    <div>
                        <p style="font-size: 22px">若想退出游戏请点击此处：
                            <button name="quit_game" value="True" id="btn-quit">退出游戏</button>
                        </p>
                    </div>


                </div>
            </div>
            {#    style="position: relative;right: -200px"#}

        </div>
        <br/>
        {#    <p>{% next_button %}</p>#}
    </div>

    </body>

    <style>
        #btn-quit {
            color: #fff;
            background-color: #007bff;
            border-color: #007bff;
        }

        .otree-timer {
            display: none;
        }


    </style>



{% endblock %}
